package jacker.bit.price;

import java.text.DateFormat;
import java.text.SimpleDateFormat;


public class UtilString {
	
	static DateFormat hm = new SimpleDateFormat("HH:mm");
	static DateFormat ymd = new SimpleDateFormat("dd/MM");
	static DateFormat ymdhm = new SimpleDateFormat("dd/MM HH:mm");
	
	public static String getDateTime(long date){
		return ymdhm.format(date);
	}
	
	public static String getDateStr(long date){
		String day = ymd.format(date); 
		if( day.equals(ymd.format(System.currentTimeMillis())) ){
			return hm.format(date);
		}else{
			return ymdhm.format(date);
		}
	}


	public static String price(float num){
		return String.format("%.2f", num);
	}
	
}


